$nt-input-shadow-invalid: inset 0 1px 2px rgba(get-color(alert), .1) !default;
$nt-input-shadow-valid: inset 0 1px 2px rgba(get-color(success), .1) !default;
$nt-input-shadow-warning: inset 0 1px 2px rgba(get-color(warning), .1) !default;

$nt-input-shadow-invalid-focus: 0 0 5px get-color(alert) !default;
$nt-input-shadow-valid-focus: 0 0 5px get-color(success) !default;
$nt-input-shadow-warning-focus: 0 0 5px get-color(warning) !default;

$nt-input-color-invalid: get-color(alert) !default;
$nt-input-color-valid: get-color(success) !default;
$nt-input-color-warning: get-color(warning) !default;

$nt-input-background-invalid: $nt-input-color-invalid !default;
$nt-input-background-valid: $nt-input-color-valid !default;
$nt-input-background-warning: $nt-input-color-warning !default;

$nt-input-symbol-offset: $input-font-size + $form-spacing !default;

$nt-form-label-width: 120px !default;
$nt-form-label-line-height: $form-label-font-size + rem-calc(4) !default;
$nt-form-label-padding-horizontal: $form-spacing !default;

@mixin nt-form-control {

  // .input-group {
  //   box-shadow: $input-shadow;
  //   border-radius: $input-radius;
  //   background-color: $input-background;
  //   transition: $input-transition;
  //   .input-group-label {
  //     color: $input-placeholder-color;
  //     border: 0;
  //     background-color: transparent;
  //     & + {
  //       select,
  //       textarea,
  //       input {
  //         padding-left: 0px;
  //       }
  //     }
  //   }
  //   select,
  //   textarea,
  //   input {
  //     box-shadow: none;
  //     background-color: transparent;
  //     & + .input-group-label {
  //       padding-right: 0px;
  //     }
  //   }
  // }


  // margin: 0 0 $form-spacing;

  font-size: $input-font-size;

  & > input {
    background-color: $input-background;
    cursor: auto !important;
    text-overflow: ellipsis;


    &.nt-has-symbol {
      padding-right: $nt-input-symbol-offset;
    }

    [pseudo="-webkit-input-placeholder"] {
      background-color: greenyellow;
    }
  }

  &.focus input {
    outline: none;
    border: $input-border-focus;
    background-color: $input-background-focus;
    box-shadow: $input-shadow-focus;
  }
}


@mixin nt-form-validate (
  $color: $nt-input-background-invalid,
  $input-shadow: $nt-input-shadow-invalid,
  $input-shadow-focus: $nt-input-shadow-invalid-focus,
  $color-lighten: 5%) {

  .nt-form-label { color: $color; }

  select,
  textarea,
  input,
  .nt-form-control input {
    border-color: $color;
    box-shadow: $input-shadow;
    // background-color: mix($color, $white, $color-lighten);
  }
  select:focus,
  textarea:focus,
  input:focus,
  .nt-form-control.focus input {
    border-color: $color;
    box-shadow: $input-shadow-focus;
  }
}

@mixin nt-form-inline {
  box-sizing: border-box;
  display: inline-block;
  position: relative;
  .nt-form-label {
    vertical-align: top;
  }
  .nt-form-group {
    display: inline-block;
  }
}

@mixin nt-form-label {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 5px;
  padding-left: .4em;
  &.required {
    position: relative;
    &:before {
      margin-left: -.6em;
      position: absolute;
      content: '*';
      color: $nt-input-color-invalid;
    }
  }
}

@mixin nt-form-horizontal {

  position: relative;

  $height: ($input-font-size * unitless-calc($input-line-height)) + (get-side($input-padding, 'top') + get-side($input-padding, 'bottom')) - rem-calc(1);

  .nt-form-label {
    vertical-align: top;
    position: absolute;
    left: 0;
    width: $nt-form-label-width;
    line-height: $nt-form-label-line-height;
    padding: ($height - $nt-form-label-line-height) / 2 $nt-form-label-padding-horizontal;
    margin-bottom: 0;
    text-align: right;
  }
  .nt-form-group {
    margin-left: $nt-form-label-width;
  }
}

@mixin nt-forms {

  .nt-form-control {
    @include nt-form-control;
  }

  .nt-form-field {
    display: block;
    .nt-form-label { @include nt-form-label; }
    &.nt-form-inline { @include nt-form-inline; }
    &.nt-form-horizontal { @include nt-form-horizontal; }
  }

  .nt-form-error {
    @include nt-form-validate;
  }
  .nt-form-success {
    @include nt-form-validate(
      $color: $nt-input-background-valid,
      $input-shadow: $nt-input-shadow-valid,
      $input-shadow-focus: $nt-input-shadow-valid-focus
    );
  }
  .nt-form-warning {
    @include nt-form-validate(
      $color: $nt-input-background-warning,
      $input-shadow: $nt-input-shadow-warning,
      $input-shadow-focus: $nt-input-shadow-warning-focus
    );
  }
}
